<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Code</title>
<meta name="description" content="CodePress source code editor window"/>
<style type="text/css">
    html {
        border: none;
    }

    /*remove ie frameborder */
    body {
        margin-top: 13px;
        _margin-top: 15px;
        background: white;
        font-family: monospace;
        font-size: 13px;
        margin-left: 32px;
        white-space: pre;
        background-image: url( "/img/linenumbers.gif" );
        background-repeat: repeat-y;
        background-position: 0 3px;
        line-height: 16px;
    }

    html>body {
        background-position: 0 2px;
    }

    P {
        margin: 0;
        padding: 0;
        border: 0;
        outline: 0;
        display: block;
        white-space: pre;
    }

    /* fonts with bold and italic must have size 12px */
    b, i, s, em, u {
        display: inline;
        font-weight: normal;
        text-decoration: none;
    }

    b {
        color: #000080;
    }

    /* tags */
    i, i b, i s, i em, i u {
        color: gray;
        font-size: 12px;
        letter-spacing: 1px
    }

    /* comments */
    s, s b {
        color: #0000ff;
    }

    /* attributes */
    em {
        color: #800080;
        font-style: normal;
    }

    /* style */
    u {
        color: #800000;
        text-decoration: none;
    }

    /* script */
</style>

<script src="/soap/ajax/10.0/connection.js" type="text/javascript"></script>

<script src="@@:AJT_codepress:@@"></script>


<script type="text/javascript">
    var scontrolId = null;
    var apexId = null;

    function init() {
        CodePress.language = 'html';
        handleOnload();

        var index = document.URL.indexOf("?");
        var query = (index == -1) ? "" : document.URL.substring(index + 1);
        var queryParams = query.split("&");
        var lang;
        var id = null;
        for (var i = 0; i < queryParams.length; i++) {
            if (queryParams[i].indexOf("ajlang=") === 0) {
                lang = queryParams[i].substring("ajlang=".length);
            }
            if (queryParams[i].indexOf("ajscid=") === 0) {
                id = queryParams[i].substring("ajscid=".length);
                /*
                var result = sforce.connection.retrieve("Name,HtmlWrapper", "SControl", [id]);
                var x = result[0].HtmlWrapper;
                //x = x.replace(/</g, '&lt;');
                //x = x.replace(/>/g, '&gt;');
                //document.getElementById("ieedt").innerHTML = x;
                CodePress.setCode("html", x);
                parent.window.document.title = result[0].Name;
                scontrolId = id;
                */
            }
        }

        if (id != null) {
            if ("apex" === lang) {
                var result = sforce.connection.retrieve("Name,Body", "ApexClass", [id]);
                var x = result[0].Body;
                CodePress.setCode("apex", x);
                parent.window.document.title = result[0].Name;
                apexId = id;
            } else if ("html" === lang) {
                var result = sforce.connection.retrieve("Name,HtmlWrapper", "SControl", [id]);
                var x = result[0].HtmlWrapper;
                CodePress.setCode("html", x);
                parent.window.document.title = result[0].Name;
                scontrolId = id;
            }
        }
    }
</script>
</head>
<body id="ffedt" onload="init()">
<pre id="ieedt"></pre>
</body>
</html>